package com.yeyks.other.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.yeyks.common.base.PageResult;
import com.yeyks.common.param.PageParam;
import com.yeyks.other.dal.domain.ActivityDrawRecord;
import com.yeyks.other.dal.dao.ActivityDrawRecordMapper;
import com.yeyks.other.service.ActivityDrawRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * <p>
 * 活动抽奖记录表 服务实现类
 * </p>
 *
 * @author yun
 * @since 2019-11-11
 */
@Service
public class ActivityDrawRecordServiceImpl extends ServiceImpl<ActivityDrawRecordMapper, ActivityDrawRecord> implements ActivityDrawRecordService {

    /**
     * 活动抽奖记录模块列表
     *
     * @param page
     * @return
     */
    @Override
    public PageResult<ActivityDrawRecord> myList(PageParam page) {
        PageHelper.startPage(page.getPageNum(), page.getPageSize());
        List<ActivityDrawRecord> activityDrawRecords = baseMapper.selectList(new QueryWrapper<ActivityDrawRecord>().orderByDesc(ActivityDrawRecord.CREATE_TIME));
        return PageResult.getPageResult(activityDrawRecords);
    }
}
